package com.meshnetics.gb.stack.core.event;

import com.meshnetics.gb.stack.core.layer.StackLayer;

/**
 * Dispatches the incoming events.
 *
 * @author mmarkov
 */
public interface EventDispatcher {
    /**
     * Dispathes the given StackRequest to the given lower layer.
     *
     * @param req StackRequest for dispatching
     * @param layer target StackLayer of request
     */
    public void dispatch(StackRequest req, StackLayer layer);

    /**
     * Dispathes the given StackResponse to the given lower layer.
     *
     * @param resp StackResponse for dispatching
     * @param layer target StackLayer of response
     */
    public void dispatch(StackResponse resp, StackLayer layer);

    /**
     * Dispatches the givent StackEvent.
     *
     * @param evt StackEvent to dispatch
     */
    public void dispatch(StackEvent evt);
}
